from selenium import webdriver
import time
import os

driver = webdriver.Chrome()
url = "file:///" + os.path.abspath("C:\\课件\\我的课件\\测试\\selenium2/locateElement/selenium2html/frame.html")
driver.get(url)
time.sleep(3)
driver.maximize_window()
# 从默认页面到 f1 框架页面
driver.switch_to.frame("f1")
driver.find_element_by_link_text("click").click()

# 回到默认页面
driver.switch_to.default_content()

driver.switch_to_frame()

time.sleep(6)
driver.quit()